#include "Pillar.h"
#include <windows.h>
#include <GL/gl.h>

CPillar::CPillar(void): m_height(5), m_thickness(1){}

void CPillar::doRender(void)
{
	glPushMatrix();
		glBegin(GL_QUADS);
			glNormal3f(0, -1, 0);
			glVertex3f(m_thickness, 0, m_thickness);
			glVertex3f(m_thickness, 0, -m_thickness);
			glVertex3f(-m_thickness, 0, -m_thickness);
			glVertex3f(-m_thickness, 0, m_thickness);

			glNormal3f(1, 0, 0);
			glVertex3f(m_thickness, 0, m_thickness);
			glVertex3f(m_thickness, 0, -m_thickness);
			glVertex3f(m_thickness, m_height, -m_thickness);
			glVertex3f(m_thickness, m_height, m_thickness);

			glNormal3f(0, 0, 1);
			glVertex3f(m_thickness, 0, m_thickness);
			glVertex3f(-m_thickness, 0, m_thickness);
			glVertex3f(-m_thickness, m_height, m_thickness);
			glVertex3f(m_thickness, m_height, m_thickness);

			glNormal3f(-1, 0, 0);
			glVertex3f(-m_thickness, 0, -m_thickness);
			glVertex3f(-m_thickness, 0, m_thickness);
			glVertex3f(-m_thickness, m_height, m_thickness);
			glVertex3f(-m_thickness, m_height, -m_thickness);

			glNormal3f(0, 0, -1);
			glVertex3f(m_thickness, 0, -m_thickness);
			glVertex3f(m_thickness, m_height, -m_thickness);
			glVertex3f(-m_thickness, m_height, -m_thickness);
			glVertex3f(-m_thickness, 0, -m_thickness);

			glNormal3f(0, 1, 0);
			glVertex3f(m_thickness, m_height, m_thickness);
			glVertex3f(m_thickness, m_height, -m_thickness);
			glVertex3f(-m_thickness, m_height, -m_thickness);
			glVertex3f(-m_thickness, m_height, m_thickness);
		glEnd();
	glPopMatrix();


}

